package a.d;

import java.util.ArrayList;
import java.util.Comparator;

class ab
  extends ArrayList
{
  private static final int a = 1;
  private Comparator c;
  
  public ab()
  {
    super(1);
    this.c = null;
  }
  
  public ab(Comparator paramComparator)
  {
    super(1);
    this.c = paramComparator;
  }
  
  public boolean a(Object paramObject)
  {
    int i = c(paramObject);
    if (!w.e) {
      if (i < 0)
      {
        i = -(i + 1);
        add(i, paramObject);
        return true;
      }
    }
    return false;
  }
  
  public boolean remove(Object paramObject)
  {
    int i = c(paramObject);
    if (!w.e) {
      if (i > -1)
      {
        remove(i);
        return true;
      }
    }
    return false;
  }
  
  public int c(Object paramObject)
  {
    boolean bool2 = w.e;
    boolean bool1 = w.d;
    int i = 0;
    int j = size() - 1;
    while (i <= j)
    {
      if (bool1) {
        break label150;
      }
      int k = (i + j) / 2;
      Object localObject = get(k);
      if (!bool2) {
        if (this.c != null)
        {
          m = this.c.compare(localObject, paramObject);
          if (bool2) {
            break label95;
          }
          if (!bool1) {
            break label93;
          }
        }
      }
      int m = ((Comparable)localObject).compareTo(paramObject);
      label93:
      label95:
      if (!bool2) {
        if (m < 0)
        {
          i = k + 1;
          if ((!bool2) && (!bool1)) {
            continue;
          }
        }
      }
      if (!bool2)
      {
        if (m > 0)
        {
          j = k - 1;
          if (!bool1) {
            break;
          }
        }
        else
        {
          if (bool2) {
            break label149;
          }
        }
      }
      else {
        return k;
      }
    }
    label149:
    label150:
    return -(i + 1);
  }
}


/* Location:           E:\idea\
 * Qualified Name:     a.d.ab
 * JD-Core Version:    0.7.0.1
 */